import request from '../request/request.ts'

//文本信息ai=》网关，不需要/partner路径=》通过/ai/chat来进行路由
export const chatAiText =  (data:any) =>  {
    return request({
        url: '/ai/chat',
        method: 'get',
        params:{
            message: data
        }
    });
}

/**
 * 创建AI助手
 * @param data 创建请求数据
 * @returns 创建的助手对象
 */
export const createAssistant = (data: any) => {
    return request({
        url: '/ai/assistant/create',
        method: 'post',
        data: data
    });
}

/**
 * 获取AI助手列表
 * @returns AI助手列表
 */
export const getAssistantList = () => {
    return request({
        url: '/ai/assistant/list',
        method: 'get'
    });
}
/**
 * 获取AI助手详情
 */
export const getAssistantDetail = (assistantId: number) => {
    return request({
        url: '/ai/assistant/detail',
        method: 'get',
        params: {
            assistantId: assistantId
        }
    })
}

/**
 * 启动文档解析任务
 */
export const startDocumentParseTask = (assistantId: number, docList: any[]) => {
    return request({
        url: '/ai/document/parse',
        method: 'post',
        params: {
            assistantId
        },
        data: docList
    });
};

/**
 * 查询文档解析任务状态
 */
export const getDocumentParseStatus = (taskId: string) => {
    return request({
        url: `/ai/document/parse/status/${taskId}`,
        method: 'get'
    });
};






